﻿#region Copyright (C) Sector7 Software Studio. All rights reserved
/*******************************************************************************************
 * Creation
 *      Author:         Wolf Lai
 *      Date:           2013/6/21 星期五 21:25:51
 *      Version:        
 * Modification 
 *      Author: 
 *      Date: 
 *      Description: 
 *      Version:
 *******************************************************************************************/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sector7.Medical.Utility;
using Sector7.Framework.Core;
using Sector7.Medical.EntityType;
using Sector7.Medical.Enums;

namespace Sector7.Medical.Biz
{
    /// <summary>
    /// STOS代理
    /// </summary>
    public class Agent_STOS
    {
        #region Public functions
        
        public static int AddPurchasesBill(M7_PurchasesBill bill)
        {
            return WcfClient.STOS.Invoke<int>(
                service => service.AddPurchasesBill(bill));
        }

        public static List<M7_Drug> GetDrugPriceListByKeywords(string keywords)
        {
            return WcfClient.STOS.Invoke<List<M7_Drug>>(
                service => service.GetDrugListWithPriceByKeywords(keywords));
        }
        /// <summary>
        /// 添加药房发药记录
        /// </summary>
        /// <param name="dispenseBill"></param>
        /// <returns></returns>
        public static int AddDispenseBill(M7_DispenseBill dispenseBill)
        {
            return WcfClient.STOS.Invoke<int>(
                    service => service.AddDispenseBill(dispenseBill));
        }

        /// <summary>
        /// 获取采购单相关药品列表
        /// </summary>
        /// <param name="keywords">关键字</param>
        /// <returns></returns>
        public static List<M7_Drug> GetDrugListForPurchasesBill(string keywords)
        {
            return WcfClient.STOS.Invoke<List<M7_Drug>>(
                service => service.GetDrugListByKeywordsAndProperties(keywords, DrugPropertyType.SpecList));
        }

        /// <summary>
        /// 添加药品规格
        /// </summary>
        /// <param name="spec"></param>
        /// <returns></returns>
        public static long AddDrugSpec(M7_DrugSpec spec)
        {
            return WcfClient.STOS.Invoke<long>(
                service => service.AddDrugSpec(spec));
        }

        /// <summary>
        /// 添加调价记录
        /// </summary>
        /// <param name="record"></param>
        /// <returns></returns>
        public static int AddAdjustRecord(M7_AdjustRecord record)
        {
            return WcfClient.STOS.Invoke<int>(
                service => service.AddAdjustRecord(record));
        }
        #endregion

        #region Private functions
        #endregion
    }
}
